using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

namespace WindowsApplication4
{
    public partial class BatteryDateReceptionBar : UserControl
    {
        BatteryEnumeration batEnum = new BatteryEnumeration();
        ReceptionLevelEnum recEnum = new ReceptionLevelEnum();
        private Boolean incomingCall = false;
        public BatteryDateReceptionBar()
        {
            InitializeComponent();
            setBatteryLevel(BatteryEnumeration.Full);
        }

        private void UserControl1_Load(object sender, EventArgs e)
        {            
            
        }
        private void timer1_Tick(object sender, EventArgs e)
        {
            if (batEnum <= BatteryEnumeration.Empty)
                batEnum++;
            else
                batEnum = 0;
            setBatteryLevel(batEnum);


            if (recEnum <= ReceptionLevelEnum.Empty)
                recEnum++;
            else
               recEnum = 0;
            setReceptionLevel(recEnum);

            if (incomingCall)
            {
               
            }
        }
        public void turnOnIncomingCallIcon()
        {
            incomingCall = true;    
        }
        public void turnOffIncomingCallIcon()
        {
            incomingCall = false;
        }
        public void setBatteryLevel(BatteryEnumeration e)
        {
            switch (e)
            {
                case BatteryEnumeration.Full:
                    pictureBox2.BackgroundImage = global::Cpsc481Phone.Properties.Resources.BatteryFull;
                    break;
                case BatteryEnumeration.ThreeQuartersFull:
                    pictureBox2.BackgroundImage = global::Cpsc481Phone.Properties.Resources.Battery75percent;
                    break;
                case BatteryEnumeration.HalfFull:
                    pictureBox2.BackgroundImage = global::Cpsc481Phone.Properties.Resources.Battery50percent;
                    break;
                case BatteryEnumeration.OneQuarterFull:
                    pictureBox2.BackgroundImage = global::Cpsc481Phone.Properties.Resources.Battery25percent;
                    break;
                case BatteryEnumeration.Empty:
                    pictureBox2.BackgroundImage = global::Cpsc481Phone.Properties.Resources.BatteryEmpty;
                    break;
            }
        }
        public void setReceptionLevel(ReceptionLevelEnum e)
        {
            switch (e)
            {
                case ReceptionLevelEnum.Full:
                    pictureBox3.BackgroundImage = global::Cpsc481Phone.Properties.Resources._5Bars;
                    break;
                case ReceptionLevelEnum.ThreeBars:
                    pictureBox3.BackgroundImage = global::Cpsc481Phone.Properties.Resources._3Bars;
                    break;
                case ReceptionLevelEnum.TwoBars:
                    pictureBox3.BackgroundImage = global::Cpsc481Phone.Properties.Resources._2Bars;
                    break;
                case ReceptionLevelEnum.OneBar:
                    pictureBox3.BackgroundImage = global::Cpsc481Phone.Properties.Resources._1Bars;
                    break;
                case ReceptionLevelEnum.Empty:
                    pictureBox3.BackgroundImage = global::Cpsc481Phone.Properties.Resources.NoBars;
                    break;
            }
        }
    }
    public enum BatteryEnumeration
    {
        Full, ThreeQuartersFull, HalfFull, OneQuarterFull, Empty,
    }
    public enum ReceptionLevelEnum
    {
        Full, ThreeBars, TwoBars, OneBar, Empty,
    }
}
